5 REM TACTILE - TANDY 1000
6 REM COPYRIGHT (C)1989 BROOKS DEFOREST
10 KEY OFF
20 DIM N(500):DIM X1(500):DIM Y1(500):DIM X2(200):DIM Y2(200):DIM X3(200):DIM Y3(200):DIM X4(200):DIM Y4(200):DIM Q(500):DIM IX(500):DIM IY(500):DIM W(500):DIM P(100):DIM O(100)
30 SCREEN 4:PALETTE 0,0:PALETTE 1,0:PALETTE 2,0:PALETTE 3,0:COLOR 1,0:CLS
40 DIM A(100):CIRCLE(10,10),8,1:CIRCLE(10,10),6,1:LINE(1,1)-(19,19),1:LINE(19,1)-(1,19),1:LINE(1,1)-(19,19),1,B:PSET(10,10),0:GET(1,1)-(20,20),A:CLS
50 DIM B(50):CIRCLE(10,10),8,3:PAINT(10,10),3:GET(1,1)-(20,20),B
60 GOTO 3480
70 REM ** START A NEW GAME **
80 SCREEN 4:PALETTE 0,0:PALETTE 1,3:PALETTE 2,4:PALETTE 3,9:COLOR 1,0:CLS
90 LINE(180,0)-(319,150),1,B:LINE(182,2)-(317,148),1,B:LINE(0,180)-(319,199),1,B:LINE(2,182)-(317,197),1,B:LINE(182,39)-(317,39),1:LINE(182,40)-(317,40),1
100 LINE(182,104)-(317,104),1:LINE(182,105)-(317,105),1
110 MO=1
120 FOR A=1 TO 160 STEP 20:LINE(A,1)-(A,160),1:LINE(1,A)-(160,A),1:NEXT:LINE(1,1)-(160,160),1,B
130 Q=0:FOR A=5 TO 155 STEP 20:FOR B=5 TO 155 STEP 20
140 Q=Q+1:IF Q=2 THEN Q=0:PAINT(A,B),1
150 NEXT:Q=Q+1:IF Q=2 THEN Q=0
160 NEXT
170 COLOR 1:LOCATE 2,26:PRINT "TACTILE V1.0"
180 LOCATE 4,26:PRINT "BY B.DEFOREST"
190 LOCATE 7,24:PRINT "SCORES:"
200 DATA 01100110
210 DATA 10000001
220 DATA 10202201
230 DATA 00202200
240 DATA 00220200
250 DATA 10220201
260 DATA 10000001
270 DATA 01100110
280 RESTORE 200:FOR A=1 TO 8:READ A$
290 FOR B=1 TO 8
300 T$=LEFT$(A$,B):T$=RIGHT$(T$,1):T=VAL(T$)
310 X=(B*20)-9:Y=(A*20)-9
320 IF T=1 THEN CIRCLE(X,Y),8,2:PAINT(X,Y),2
330 IF T=2 THEN CIRCLE(X,Y),8,3:PAINT(X,Y),3
340 NEXT
350 NEXT
360 REM GET USERS MOVE
370 LOCATE 10,24:PRINT "PLAYER"PL" ":LOCATE 12,24:PRINT "MAX"CM" ":GOSUB 2920
380 LOCATE 16,28:PRINT "MOVE"MO" "
390 LOCATE 24,12:PRINT "PLAYER SELECT MOVE"
400 PLAY "C40A40C40"
410 X=2:Y=2:PUT(X,Y),A
420 A$=INKEY$:IF A$="" THEN 420
421 IF A$=CHR$(27) THEN RUN "MAX"
430 PUT(X,Y),A
440 IF A$="4" AND X<>2 THEN X=X-20
450 IF A$="6" AND X<>142 THEN X=X+20
460 IF A$="8" AND Y<>2 THEN Y=Y-20
470 IF A$="2" AND Y<>142 THEN Y=Y+20
480 TYPE=POINT(X+8,Y+8):IF A$=" " AND TYPE=3 THEN 520 ELSE IF A$=" " AND TYPE=2 THEN PALETTE 3,14:PALETTE 3,15:PALETTE 3,9
490 PUT(X,Y),A
500 PLAY "A40"
510 GOTO 420
520 REM GET NEW POSITION
530 X2=X:Y2=Y:EX=X+9:EY=Y+9:GOSUB 880
540 PUT(X,Y),B
550 PLAY "C40A40C40"
560 A$=INKEY$:IF A$="" THEN 560
570 PUT(X,Y),B
580 IF A$="4" AND X<>2 THEN X=X-20
590 IF A$="6" AND X<>142 THEN X=X+20
600 IF A$="8" AND Y<>2 THEN Y=Y-20
610 IF A$="2" AND Y<>142 THEN Y=Y+20
620 TYPE=POINT(X+8,Y+8)
630 IF A$=CHR$(27) THEN CIRCLE(X2+9,Y2+9),8,3:PAINT(X2+9,Y2+9),3:GOTO 360
640 IF A$=" " AND X=X2 AND Y=Y2 THEN A$=CHR$(27):GOTO 630
650 IF A$=" " AND TYPE=0 THEN 670 ELSE IF A$=" " AND TYPE=1 THEN 670
660 PUT(X,Y),B:GOTO 560
670 REM ** PLAYER CHECK **
680 IF X>X2 THEN A1=X:A2=X2 ELSE A1=X2:A2=X
690 IF Y>Y2 THEN B1=Y:B2=Y2 ELSE B1=Y2:B2=Y
700 DF1=A1-A2:DF2=B1-B2
710 IF DF1=20 AND DF2=20 THEN GOTO 870
720 IF DF1>20 OR DF2>20 THEN 730 ELSE 870
730 XX2=X2:YY2=Y2:X2=X2+9:Y2=Y2+9
740 P1=POINT(X2-20,Y2-20):P2=POINT(X2,Y2-20):P3=POINT(X2+20,Y2-20)
750 P4=POINT(X2-20,Y2):P5=POINT(X2+20,Y2)
760 P6=POINT(X2-20,Y2+20):P7=POINT(X2,Y2+20):P8=POINT(X2+20,Y2+20)
770 IF X=XX2-40 AND Y=YY2-40 AND P1=2 THEN PL=PL+1:EX=X2-20:EY=Y2-20:GOSUB 880:GOTO 870
780 IF X=XX2 AND Y=YY2-40 AND P2=2 THEN PL=PL+1:EX=X2:EY=Y2-20:GOSUB 880:GOTO 870
790 IF X=XX2+40 AND Y=YY2-40 AND P3=2 THEN PL=PL+1:EX=X2+20:EY=Y2-20:GOSUB 880:GOTO 870
800 IF X=XX2-40 AND Y=YY2 AND P4=2 THEN PL=PL+1:EX=X2-20:EY=Y2:GOSUB 880:GOTO 870
810 IF X=XX2+40 AND Y=YY2 AND P5=2 THEN PL=PL+1:EX=X2+20:EY=Y2:GOSUB 880:GOTO 870
820 IF X=XX2-40 AND Y=YY2+40 AND P6=2 THEN PL=PL+1:EX=X2-20:EY=Y2+20:GOSUB 880:GOTO 870
830 IF X=XX2 AND Y=YY2+40 AND P7=2 THEN PL=PL+1:EX=X2:EY=Y2+20:GOSUB 880:GOTO 870
840 IF X=XX2+40 AND Y=YY2+40 AND P8=2 THEN PL=PL+1:EX=X2+20:EY=Y2+20:GOSUB 880:GOTO 870
850 X2=XX2:Y2=YY2
860 NOISE 0,15,1:PALETTE 1,14:PALETTE 1,15:PALETTE 1,14:PALETTE 1,3:PUT(X,Y),B:GOTO 560
870 PLX=X+9:PLY=Y+9:CIRCLE(X+9,Y+9),8,3:PAINT(X+9,Y+9),3:PLAY "E40F40G40":GOTO 910
880 REM ** ERASE PIECE **
890 EC=POINT(EX-9,EY-9):CIRCLE(EX,EY),8,EC:PAINT(EX,EY),EC
900 RETURN
910 REM ** COMPUTER PLAYER **
920 LOCATE 24,2:PRINT STRING$(30,32):GOSUB 2720
930 RANDOMIZE TIMER
940 GOSUB 2920:LOCATE 24,13:PRINT "MAX IS THINKING"
950 FOR N=1 TO N2:X1(N)=0:X2(N)=0:X3(N)=0:X4(N)=0:Y1(N)=0:Y2(N)=0:Y3(N)=0:Y4(N)=0:NEXT:N=0:N2=0
960 FOR Y=8 TO 150 STEP 20:FOR X=8 TO 150 STEP 20
970 SQ=POINT(X,Y):IF SQ<>2 THEN 1200
980 P1=POINT(X-20,Y-20):P2=POINT(X,Y-20):P3=POINT(X+20,Y-20)
990 P4=POINT(X-20,Y):P5=POINT(X+20,Y)
1000 P6=POINT(X-20,Y+20):P7=POINT(X,Y+20):P8=POINT(X+20,Y+20)
1010 O1=POINT(X-40,Y-40):O2=POINT(X,Y-40):O3=POINT(X+40,Y-40)
1020 O4=POINT(X-40,Y):O5=POINT(X+40,Y)
1030 O6=POINT(X-40,Y+40):O7=POINT(X,Y+40):O8=POINT(X+40,Y+40)
1040 IF O1=1 THEN O1=0
1050 IF O2=1 THEN O2=0
1060 IF O3=1 THEN O3=0
1070 IF O4=1 THEN O4=0
1080 IF O5=1 THEN O5=0
1090 IF O6=1 THEN O6=0
1100 IF O7=1 THEN O7=0
1110 IF O8=1 THEN O8=0
1120 IF P1=3 AND O1=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-40:Y2(N)=Y-40
1130 IF P2=3 AND O2=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y-40
1140 IF P3=3 AND O3=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+40:Y2(N)=Y-40
1150 IF P4=3 AND O4=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-40:Y2(N)=Y
1160 IF P5=3 AND O5=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+40:Y2(N)=Y
1170 IF P6=3 AND O6=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-40:Y2(N)=Y+40
1180 IF P7=3 AND O7=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y+40
1190 IF P8=3 AND O8=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+40:Y2(N)=Y+40
1200 NEXT:NEXT
1210 REM ** COMPUTER DECIDE MOVE **
1220 PLAY "C40"
1230 N2=N:FOR N=1 TO N2
1240 X=X1(N):Y=Y1(N):Y2=Y2(N):X2=X2(N)
1250 P1=POINT(X2-20,Y2-20):P2=POINT(X2,Y2-20):P3=POINT(X2+20,Y2-20)
1260 P4=POINT(X2-20,Y2):P5=POINT(X2+20,Y2)
1270 P6=POINT(X2-20,Y2+20):P7=POINT(X2,Y2+20):P8=POINT(X2+20,Y2+20)
1280 O1=POINT(X2-40,Y2-40):O2=POINT(X2,Y2-40):O3=POINT(X2+40,Y2-40)
1290 O4=POINT(X2-40,Y2):O5=POINT(X2+40,Y2)
1300 O6=POINT(X2-40,Y2+40):O7=POINT(X2,Y2+40):O8=POINT(X2+40,Y2+40)
1310 IF O1=1 THEN O1=0
1320 IF O2=1 THEN O2=0
1330 IF O3=1 THEN O3=0
1340 IF O4=1 THEN O4=0
1350 IF O5=1 THEN O5=0
1360 IF O6=1 THEN O6=0
1370 IF O7=1 THEN O7=0
1380 IF O8=1 THEN O8=0
1390 IF P1=3 AND O1=0 THEN X3(N)=X2-40:Y3(N)=Y2-40
1400 IF P2=3 AND O2=0 THEN X3(N)=X2:Y3(N)=Y3-40
1410 IF P3=3 AND O3=0 THEN X3(N)=X2+40:Y3(N)=Y2-40
1420 IF P4=3 AND O4=0 THEN X3(N)=X2-40:Y3(N)=Y2
1430 IF P5=3 AND O5=0 THEN X3(N)=X2+40:Y3(N)=Y2
1440 IF P6=3 AND O6=0 THEN X3(N)=X2-40:Y3(N)=Y2+40
1450 IF P7=3 AND O7=0 THEN X3(N)=X2:Y3(N)=Y2+40
1460 IF P8=3 AND O8=0 THEN X3(N)=X2+40:Y3(N)=Y2+40
1470 NEXT
1480 REM ** LAST RUN **
1490 CNT=0:FOR N=1 TO N2
1500 X3=X3(N):Y3=Y3(N):IF X3=0 AND Y3=0 THEN 1740
1510 P1=POINT(X3-20,Y3-20):P2=POINT(X3,Y3-20):P3=POINT(X3+20,Y3-20)
1520 P4=POINT(X3-20,Y3):P5=POINT(X3+20,Y3)
1530 P6=POINT(X3-20,Y3+20):P7=POINT(X3,Y3+20):P8=POINT(X3+20,Y3+20)
1540 X3=X3(N):Y3=Y3(N):IF X3=0 AND Y3=0 THEN 1740
1550 O1=POINT(X3-40,Y3-40):O2=POINT(X3,Y3-40):O3=POINT(X3+40,Y3-40)
1560 O4=POINT(X3-40,Y3):O5=POINT(X3+40,Y3)
1570 O6=POINT(X3-40,Y3+40):O7=POINT(X3,Y3+40):O8=POINT(X3+40,Y3+40)
1580 IF O1=1 THEN O1=0
1590 IF O2=1 THEN O2=0
1600 IF O3=1 THEN O3=0
1610 IF O4=1 THEN O4=0
1620 IF O5=1 THEN O5=0
1630 IF O6=1 THEN O6=0
1640 IF O7=1 THEN O7=0
1650 IF O8=1 THEN O8=0
1660 IF P1=3 AND O1=0 THEN X4(N)=X3-40:Y4(N)=Y3-40
1670 IF P2=3 AND O2=0 THEN X4(N)=X3:Y4(N)=Y3-40
1680 IF P3=3 AND O3=0 THEN X4(N)=X3+40:Y4(N)=Y3-40
1690 IF P4=3 AND O4=0 THEN X4(N)=X3-40:Y4(N)=Y3
1700 IF P5=3 AND O5=0 THEN X4(N)=X3+40:Y4(N)=Y3
1710 IF P6=3 AND O6=0 THEN X4(N)=X3-40:Y4(N)=Y3+40
1720 IF P7=3 AND O7=0 THEN X4(N)=X3:Y4(N)=Y3+40
1730 IF P8=3 AND O8=0 THEN X4(N)=X3+40:Y4(N)=Y3+40
1740 NEXT
1750 REM ** SORT MOVES **
1760 Q=0:Q2=0
1770 M1X=0:M2X=0:M3X=0:M4X=0:M1Y=0:M2Y=0:M3Y=0:M4Y=0
1780 PLAY "B40"
1790 FOR N=1 TO N2
1800 IF X3(N)<>0 THEN Q=Q+1:IX(Q)=N
1810 NEXT:Q2=Q
1820 IF Q2=0 AND N2=0 THEN 2200
1830 IF Q2=0 THEN N=1+FIX(RND*N2-1):M1X=X1(N):M2X=X2(N):M1Y=Y1(N):M2Y=Y2(N):GOTO 1900
1840 FOR Q=1 TO Q2
1850 IF X4(N)<>0 THEN W=W+1:IY(W)=Q
1860 NEXT:W2=W
1870 IF W2=0 THEN Q=1+FIX(RND*Q2-1):N=IX(Q):M1X=X1(N):M2X=X2(N):M3X=X3(N):M1Y=Y1(N):M2Y=Y2(N):M3Y=Y3(N):GOTO 1900
1880 W=1+FIX(RND*W2-1):Q=IY(W):N=IX(Q):M1X=X1(N):M2X=X2(N):M3X=X3(N):M4X=X4(N):M1Y=Y1(N):M2Y=Y2(N):M3Y=Y3(N):M4Y=Y4(N):GOTO 1900
1890 GOTO 2200
1900 IF M1X=0 THEN 2200
1910 IF M1X>155 OR M2X>155 OR M3X>155 OR M4X>155 OR M1Y>155 OR M2Y>155 OR M3Y>155 OR M4Y>155 THEN 2200
1920 IF M2X>0 THEN CM=CM+1:IF M3X>0 THEN CM=CM+1:IF M4X>0 THEN CM=CM+1
1930 DX1=M2X-M1X:DY1=M2Y-M1Y
1940 EX1=M1X+DX1:EY1=M1Y+DY1
1950 DX2=M3X-M2X:DY2=M3Y-M2Y
1960 EX2=M2X+DX2:EY2=M2Y+DY2
1970 DX3=M4X-M3X:DY3=M4Y-M3Y
1980 EX3=M3X+DX3:EY3=M3Y+DY3
1990 IF EX1>M1X THEN EX1=EX1-20 ELSE IF EX1<M1X THEN EX1=EX1+20
2000 IF EY1>M1Y THEN EY1=EY1-20 ELSE IF EY1<M1Y THEN EY1=EY1+20
2010 GOSUB 2120
2020 EX1=EX1+3:EX2=EX2+3:EX3=EX3+3:EY1=EY1+3:EY2=EY2+3:EY3=EY3+3
2030 REM ** HOW MANY? **
2040 CNT=0
2050 IF M2X<>0 THEN CNT=1:IF M3X<>0 THEN CNT=2:IF M4X<>0 THEN CNT=3
2060 REM ** ERASE TAKEN PIECES **
2070 EX=M1X+3:EY=M1Y+3:GOSUB 880
2080 IF CNT=1 THEN EX=EX1:EY=EY1:GOSUB 880:X=M2X+3:Y=M2Y+3:GOTO 2170
2090 IF CNT=2 THEN EX=EX1:EY=EY1:GOSUB 880:EX=EX2:EY=EY2:GOSUB 880:X=M3X+3:Y=M3Y+3:GOTO 2170
2100 IF CNT=3 THEN EX=EX1:EY=EY1:GOSUB 880:EX=EX2:EY=EY2:GOSUB 880:EX=EX3:EY=EY3:GOSUB 880:X=M4X+3:Y=M4Y+3:GOTO 2170
2110 GOTO 2200
2120 IF EX2>M2X THEN EX2=EX2-20 ELSE IF EX2<M2X THEN EX2=EX2+20
2130 IF EY2>M2Y THEN EY2=EY2-20 ELSE IF EY2<M2Y THEN EY2=EY2+20
2140 IF EX3>M3X THEN EX3=EX3-20 ELSE IF EX3<M3X THEN EX3=EX3+20
2150 IF EY3>M3Y THEN EY3=EY3-20 ELSE IF EY3<M3Y THEN EY3=EY3+20
2160 RETURN
2170 CMX=X:CMY=Y:CNT=0:M1X=0:M2X=0:M3X=0:M4X=0
2180 LOCATE 24,2:PRINT STRING$(30,32)
2190 PLAY "E40F40G40":CIRCLE(X,Y),8,2:PAINT(X,Y),2:GOSUB 2880:MO=MO+1:GOTO 360
2200 REM ** CREATE MOVE **
2210 FOR P=1 TO 8:O(P)=0:NEXT
2220 GOSUB 3030:N2=N:IF N>0 THEN 1750
2230 DRX=FIX(RND*10):DRY=FIX(RND*10)
2240 IF DRX<3 THEN DRX=0 ELSE IF DRX<6 THEN DRX=1 ELSE DRX=2
2250 IF DRY<3 THEN DRY=0 ELSE IF DRY<6 THEN DRY=1 ELSE DRY=2
2260 REM ** SELECT ITEM **
2270 FOR N=1 TO N2:X1(N)=0:X2(N)=0:X3(N)=0:X4(N)=0:Y1(N)=0:Y2(N)=0:Y3(N)=0:Y4(N)=0:NEXT:N=0:N2=0
2280 CP=0:FOR Y=8 TO 150 STEP 20:FOR X=8 TO 150 STEP 20
2290 SQ=POINT(X,Y):IF SQ=2 THEN CP=CP+1
2300 NEXT:NEXT
2310 IF CP=0 THEN 360
2320 IF CP=1 THEN MV=1:GOTO 2340
2330 CP2=CP:CP=1+FIX(RND*CP2-1):MV=CP
2340 CP=0:P=0:FOR Y=8 TO 150 STEP 20:P=P+1:FOR X=8 TO 150 STEP 20
2350 SQ=POINT(X,Y):IF SQ=2 THEN CP=CP+1 ELSE IF SQ=3 THEN O(P)=O(P)+1
2360 IF CP=MV THEN X1=X+3:Y1=Y+3:GOTO 2380
2370 NEXT:NEXT:GOTO 360
2380 X=X1:Y=Y1:GOSUB 2640
2390 P1=POINT(X-20,Y-20):P2=POINT(X,Y-20):P3=POINT(X+20,Y-20)
2400 P4=POINT(X-20,Y):P5=POINT(X+20,Y)
2410 P6=POINT(X-20,Y+20):P7=POINT(X,Y+20):P8=POINT(X+20,Y+20)
2420 IF P1=1 THEN P1=0
2430 IF P2=1 THEN P2=0
2440 IF P3=1 THEN P3=0
2450 IF P4=1 THEN P4=0
2460 IF P5=1 THEN P5=0
2470 IF P6=1 THEN P6=0
2480 IF P7=1 THEN P7=0
2490 IF P8=1 THEN P8=0
2500 IF P1<>0 AND P2<>0 AND P3<>0 AND P4<>0 AND P5<>0 AND P6<>0 AND P7<>0 AND P8<>0 THEN 2510 ELSE 2540
2510 IF CP2=1 THEN 360
2520 IF CP2=2 THEN MV=2:GOTO 2340
2530 CP=CP2:GOTO 2330
2540 IF DRX=2 AND X>135 THEN 2200 ELSE IF DRY=2 AND Y>135 THEN 2200
2550 IF DRX=1 AND DRY=1 AND P1=0 THEN EX=X:EY=Y:GOSUB 880:X=X-20:Y=Y-20:GOTO 2170
2560 IF DRX=0 AND DRY=1 AND P2=0 THEN EX=X:EY=Y:GOSUB 880:Y=Y-20:GOTO 2170
2570 IF DRX=2 AND DRY=1 AND P3=0 THEN EX=X:EY=Y:GOSUB 880:X=X+20:Y=Y-20:GOTO 2170
2580 IF DRX=1 AND DRY=0 AND P4=0 THEN EX=X:EY=Y:GOSUB 880:X=X-20:GOTO 2170
2590 IF DRX=2 AND DRY=0 AND P5=0 THEN EX=X:EY=Y:GOSUB 880:X=X+20:GOTO 2170
2600 IF DRX=1 AND DRY=2 AND P6=0 THEN EX=X:EY=Y:GOSUB 880:X=X-20:Y=Y+20:GOTO 2170
2610 IF DRX=0 AND DRY=2 AND P7=0 THEN EX=X:EY=Y:GOSUB 880:Y=Y+20:GOTO 2170
2620 IF DRX=2 AND DRY=2 AND P8=0 THEN EX=X:EY=Y:GOSUB 880:Y=Y+20:X=X+20:GOTO 2170
2630 GOTO 2200
2640 REM ** TACTICS **
2650 UP=0:DN=0:TOT=0:FOR P=1 TO 8:TOT=TOT+O(P):NEXT
2660 FOR P=1 TO 8
2670 IF P<5 THEN UP=UP+O(P) ELSE DN=DN+O(P)
2680 NEXT
2690 IF UP>DN+(TOT/8) THEN DR2=1
2700 IF DN>UP+(TOT/8) THEN DR2=2
2710 RETURN
2720 REM ** THE VIRUS (player) **
2730 X=PLX:Y=PLY:CL1=2:CPL=3
2740 P1=POINT(X-20,Y-20):P2=POINT(X,Y-20):P3=POINT(X+20,Y-20)
2750 P4=POINT(X-20,Y):P5=POINT(X+20,Y)
2760 P6=POINT(X-20,Y+20):P7=POINT(X,Y+20):P8=POINT(X+20,Y+20)
2770 IF CPL=2 THEN P2=0:P4=0:P5=0:P7=0:GOTO 2790
2780 IF P1=2 OR P3=2 OR P6=2 OR P8=2 THEN CIRCLE(X,Y),8,2:PAINT(X,Y),2:CPL=2
2790 IF P1=CL1 THEN CIRCLE(X-20,Y-20),8,CPL:PAINT(X-20,Y-20),CPL
2800 IF P2=CL1 THEN CIRCLE(X,Y-20),8,CPL:PAINT(X,Y-20),CPL
2810 IF P3=CL1 THEN CIRCLE(X+20,Y-20),8,CPL:PAINT(X+20,Y-20),CPL
2820 IF P4=CL1 THEN CIRCLE(X-20,Y),8,CPL:PAINT(X-20,Y),CPL
2830 IF P5=CL1 THEN CIRCLE(X+20,Y),8,CPL:PAINT(X+20,Y),CPL
2840 IF P6=CL1 THEN CIRCLE(X-20,Y+20),8,CPL:PAINT(X-20,Y+20),CPL
2850 IF P7=CL1 THEN CIRCLE(X,Y+20),8,CPL:PAINT(X,Y+20),CPL
2860 IF P8=CL1 THEN CIRCLE(X+20,Y+20),8,CPL:PAINT(X+20,Y+20),CPL
2870 RETURN
2880 REM ** THE VIRUS (computer) **
2890 X=CMX:Y=CMY:CL1=3:CPL=2
2900 GOSUB 2740
2910 RETURN
2920 REM ** CHECK ALL PIECES **
2930 CHKP=0:CHKC=0
2940 FOR A=1 TO 141 STEP 20:FOR B=1 TO 141 STEP 20
2950 PP=POINT(B+8,A+8)
2960 IF PP=3 THEN CHKP=1
2970 IF PP=2 THEN CHKC=1
2980 IF CHKP=1 AND CHKC=1 THEN 3020
2990 NEXT:NEXT
3000 IF CHKP=1 THEN LOCATE 24,2:PRINT STRING$(30,32):LOCATE 24,15:PRINT "PLAYER WINS":WHILE INKEY$<>" ":WEND:RUN
3010 IF CHKC=1 THEN LOCATE 24,2:PRINT STRING$(30,32):LOCATE 24,16:PRINT "MAX WINS":WHILE INKEY$<>" ":WEND:RUN
3020 RETURN
3030 REM ** Max Virus Tactics **
3040 FOR N=1 TO N2:X1(N)=0:X2(N)=0:X3(N)=0:X4(N)=0:Y1(N)=0:Y2(N)=0:Y3(N)=0:Y4(N)=0:NEXT:N=0:N2=0
3050 FOR Y=8 TO 150 STEP 20:FOR X=8 TO 150 STEP 20
3060 SQ=POINT(X,Y):IF SQ<>2 THEN 3460
3070 P1=POINT(X-20,Y-20):P2=POINT(X,Y-20):P3=POINT(X+20,Y-20)
3080 P4=POINT(X-20,Y):P5=POINT(X+20,Y)
3090 P6=POINT(X-20,Y+20):P7=POINT(X,Y+20):P8=POINT(X+20,Y+20)
3100 O1=POINT(X-40,Y-40):O2=POINT(X,Y-40):O3=POINT(X+40,Y-40)
3110 O4=POINT(X-40,Y):O5=POINT(X+40,Y)
3120 O6=POINT(X-40,Y+40):O7=POINT(X,Y+40):O8=POINT(X+40,Y+40)
3130 IF O1=1 THEN O1=0
3140 IF O2=1 THEN O2=0
3150 IF O3=1 THEN O3=0
3160 IF O4=1 THEN O4=0
3170 IF O5=1 THEN O5=0
3180 IF O6=1 THEN O6=0
3190 IF O7=1 THEN O7=0
3200 IF O8=1 THEN O8=0
3210 IF P1=1 THEN P1=0
3220 IF P2=1 THEN P2=0
3230 IF P3=1 THEN P3=0
3240 IF P4=1 THEN P4=0
3250 IF P5=1 THEN P5=0
3260 IF P6=1 THEN P6=0
3270 IF P7=1 THEN P7=0
3280 IF P8=1 THEN P8=0
3290 IF P1=0 AND O1=3 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-20:Y2(N)=Y-20
3300 IF P3=0 AND O3=3 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+20:Y2(N)=Y-20
3310 IF P6=0 AND O6=3 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-20:Y2(N)=Y+20
3320 IF P8=0 AND O8=3 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+20:Y2(N)=Y+20
3330 IF P5=3 AND P2=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y-20
3340 IF P5=3 AND P7=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y+20
3350 IF P7=3 AND P4=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-20:Y2(N)=Y
3360 IF P7=3 AND P5=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:Y2(N)=X+20:Y2(N)=Y
3370 IF P1=0 AND P2=0 AND P3=0 AND P4=0 AND P5=0 AND P6=0 AND P7=0 AND P8=0 THEN 3460
3380 IF P2=3 AND P4=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-20:Y2(N)=Y
3390 IF P2=3 AND P5=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+20:Y2(N)=Y
3400 IF P4=3 AND P2=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y-20
3410 IF P4=3 AND P7=0 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y+20
3420 IF O2=3 AND Y+20<155 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y+20
3430 IF O4=3 AND X+20<155 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X+20:Y2(N)=Y
3440 IF O5=3 AND X-20>10 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X-20:Y2(N)=Y
3450 IF O7=3 AND Y-20>10 THEN N=N+1:X1(N)=X:Y1(N)=Y:X2(N)=X:Y2(N)=Y-20
3460 NEXT:NEXT
3470 RETURN
3480 REM >>INSTRUCTIONS<<
3490 SCREEN 2:SCREEN 0
3500 VIEW PRINT 1 TO 25
3510 COLOR 10:LOCATE 1,34:PRINT "T A C T I L E"
3530 COLOR 13
3540 LOCATE 3,1:PRINT CHR$(218)STRING$(78,196)CHR$(191)
3550 FOR Y=4 TO 20:LOCATE Y,1:PRINT CHR$(179):LOCATE Y,80:PRINT CHR$(179):NEXT
3560 LOCATE 21,1:PRINT CHR$(192)STRING$(78,196)CHR$(217)
3570 COLOR 15
3580 LOCATE 4,3:PRINT "Tactile is a stratergy board game created for the Tandy 1000 computer system "
3590 LOCATE 5,3:PRINT "and uses MAX Artificial Intelligence."
3600 LOCATE 7,3:PRINT "The game is played on a Checker type grid of 64 squares (8x8),on which all of"
3610 LOCATE 8,3:PRINT "the pieces are placed.The aim of the game is to eliminate all of Max's pieces"
3620 LOCATE 9,3:PRINT "this can be done in one of two ways;by ~Taking~,and ~Infecting~."
3630 LOCATE 10,3:PRINT "Taking a place is done when Max's piece is next to one of your pieces and it"
3640 LOCATE 11,3:PRINT "has a spare square in a diagonal with your piece.To take Max's piece simply"
3650 LOCATE 12,3:PRINT "select your piece to move and the select the spare square."
3660 LOCATE 14,3:PRINT "Infection is when a moved piece lands next to a piece of the opersite side."
3670 LOCATE 15,3:PRINT "The direction of infection is different for Max and you:"
3680 LOCATE 16,3:PRINT "     MAX (RED)    PLAYER (BLUE)
3690 LOCATE 17,3:PRINT "    *   *           *           Only pieces directly next to the"
3700 LOCATE 18,3:PRINT "      @           * @ *         moved piece will be affected by"
3710 LOCATE 19,3:PRINT "    *   *           *           any infection."
3720 COLOR 9:LOCATE 22,1:PRINT " Use number pad to select piece and position then press space to confirm choice"
3730 COLOR 12:LOCATE 24,1:PRINT "       >>  >>  >>      >>>>   Press Space To Start   <<<<     <<  <<  <<        "
3740 A$=INKEY$:IF A$=" " THEN 3750 ELSE IF A$=CHR$(27) THEN SYSTEM ELSE 3740
3750 PL=0:CM=0
3760 GOTO 70
3770 END
